package com.stylefeng.guns.modular.netcar.warpper;

import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper;
import com.stylefeng.guns.core.util.SpringContextHolder;
import com.stylefeng.guns.modular.system.dao.UserCwMapper;
import com.stylefeng.guns.modular.system.model.UserCw;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

/**
 * 部门列表的包装
 *
 * @author fengshuonan
 * @date 2017年4月25日 18:10:31
 */
public class LineDispatchPsnWarpper extends BaseControllerWarpper {

    private UserCwMapper userCwMapper= SpringContextHolder.getBean(UserCwMapper.class);

    public LineDispatchPsnWarpper(Object list) {
        super(list);
    }

  @Override
  public void warpTheMap(Map<String, Object> map) {
        String suId = (String) map.get("suId"); // 用户ID
        if (StringUtils.isNotBlank(suId)) {
            UserCw userCw=userCwMapper.selectById(suId);
            if(userCw!=null)
                map.put("suName", userCw.getSuiName());
        }
    }
}
